request.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 51

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 51
cc 1
rs 9.4109

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
/**
2
 * The FisherRequest used in a fisherCallback
3
 * @class FisherRequest
4
 */
5
class FisherRequest {
6
    /**
7
     * Creates an instance of FisherRequest.
8
     * @param {Fisherman} client
9
     */
10
  constructor (client) {
11
        /**
12
         * is it a command
13
         * @name FisherRequest#isCommand
14
         * @type {boolean}
15
         * @default false
16
         * @readonly
17
         */
18
    this.isCommand = false
19
        /**
20
         * the command if there is one
21
         * @name FisherRequest#command
22
         * @type {Command}
23
         * @default null
24
         */
25
    this.command = null
26
        /**
27
         * the register of the command
28
         * @name FisherRequest#register
29
         * @type {FisherRegister}
30
         * @default null
31
         */
32
    this.register = null
33
        /**
34
         * the prefix trigered
35
         * @name FisherRequest#prefix
36
         * @type {string}
37
         * @default null
38
         */
39
    this.prefix = null
40
        /**
41
         * The discord.js channel
42
         * @name FisherRequest#channel
43
         * @type {GuildChannel}
44
         * @default null
45
         */
46
    this.channel = null
47
        /**
48
         * The dicord.js message
49
         * @name FisherRequest#message
50
         * @type {Message}
51
         * @default null
52
         */
53
    this.message = null
54
        /**
55
         * The Fisherman client
56
         * @name FisherRequest#client
57
         * @type {Fisherman}
58
         */
59
    Object.defineProperty(this, 'client', { value: client })
60
  }
61
}
62
module.exports = FisherRequest
63